package com.eascs.p2p.common.entity;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import com.eascs.p2p.common.wallet.utils.BigDecimalUtils;


/**
 * The persistent class for the p2p_invest_object database table.
 * 
 */
@Entity
@Table(name="p2p_invest_object")
@NamedQuery(name="P2pInvestObject.findAll", query="SELECT p FROM P2pInvestObject p")
public class InvestObjectEntity implements Serializable {
	private static final long serialVersionUID = 1L;
	/**期限类型：0-天 1-月*/
	public static final int DEADLINE_TYPE_YEAR=1;
	public static final int DEADLINE_TYPE_DAY=0;
	
	/**标的状态:1-未审核 2-审核通过（未发布） 3-发布中 4-满标 5-放款完成（还款中） 6-已完结 7-还款异常 8-逾期结清 9-审核驳回 10-终止*/
	public static final int OBJ_STATUS_PUBLISH=3;
	public static final int OBJ_STATUS_FULL=4;
	
	@Id
	private String id;
	@Column(name="bill_code")
	private String billCode;

	@Column(name="annualized_yield")
	private BigDecimal annualizedYield;

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="create_time")
	private Date createTime;

	private String creator;

	private int deadline;

	@Column(name="deadline_type")
	private int deadlineType;

	private String features;
	@Column(name="group_team")
	private String groupTeam;

	@Column(name="invested_amount")
	private BigDecimal investedAmount;

	@Column(name="is_del")
	private int isDel;

	@Column(name="loan_amount")
	private BigDecimal loanAmount;

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="loan_time")
	private Date loanTime;

	@Column(name="loanee_id")
	private String loaneeId;
	
	@Column(name="loanee_name")
	private String loaneeName;

	private String loaner;

	@Column(name="lowest_investent_amount")
	private BigDecimal lowestInvestentAmount;

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="object_fulfill")
	private Date objectFulfill;

	@Column(name="object_intro")
	private String objectIntro;

	@Column(name="object_status")
	private int objectStatus;

	private String publisher;

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="publisher_time")
	private Date publisherTime;

	@Column(name="refund_type")
	private int refundType;

	private String regenerator;

	@Column(name="service_fee_rate")
	private BigDecimal serviceFeeRate;

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="terminate_time")
	private Date terminateTime;

	private String terminator;

	private String title;

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="update_time")
	private Date updateTime;

	private String verifier;

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="verifier_time")
	private Date verifierTime;

	private int version;

	@Column(name="failure_time")
	private Date failureTime; 
	
	@Column(name="online_time")
	private Date onlineTime; 
	
	public InvestObjectEntity() {
	}

	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public BigDecimal getAnnualizedYield() {
		return BigDecimalUtils.convertNull(this.annualizedYield);
	}

	public void setAnnualizedYield(BigDecimal annualizedYield) {
		this.annualizedYield = annualizedYield;
	}

	public Date getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public String getCreator() {
		return this.creator;
	}

	public void setCreator(String creator) {
		this.creator = creator;
	}

	public int getDeadline() {
		return deadline;
	}

	public void setDeadline(int deadline) {
		this.deadline = deadline;
	}

	public String getFeatures() {
		return this.features;
	}

	public void setFeatures(String features) {
		this.features = features;
	}

	public String getGroupTeam() {
		return groupTeam;
	}

	public void setGroupTeam(String groupTeam) {
		this.groupTeam = groupTeam;
	}

	public BigDecimal getInvestedAmount() {
		return BigDecimalUtils.convertNull(this.investedAmount);
	}

	public void setInvestedAmount(BigDecimal investedAmount) {
		this.investedAmount = investedAmount;
	}


	public BigDecimal getLoanAmount() {
		return BigDecimalUtils.convertNull(this.loanAmount);
	}

	public void setLoanAmount(BigDecimal loanAmount) {
		this.loanAmount = loanAmount;
	}

	public Date getLoanTime() {
		return this.loanTime;
	}

	public void setLoanTime(Date loanTime) {
		this.loanTime = loanTime;
	}

	public String getLoaneeId() {
		return this.loaneeId;
	}

	public void setLoaneeId(String loaneeId) {
		this.loaneeId = loaneeId;
	}

	public String getLoaner() {
		return this.loaner;
	}

	public void setLoaner(String loaner) {
		this.loaner = loaner;
	}

	public BigDecimal getLowestInvestentAmount() {
		return BigDecimalUtils.convertNull(this.lowestInvestentAmount);
	}

	public void setLowestInvestentAmount(BigDecimal lowestInvestentAmount) {
		this.lowestInvestentAmount = lowestInvestentAmount;
	}

	public Date getObjectFulfill() {
		return this.objectFulfill;
	}

	public void setObjectFulfill(Date objectFulfill) {
		this.objectFulfill = objectFulfill;
	}

	public String getObjectIntro() {
		return this.objectIntro;
	}

	public void setObjectIntro(String objectIntro) {
		this.objectIntro = objectIntro;
	}

	public int getObjectStatus() {
		return objectStatus;
	}

	public void setObjectStatus(int objectStatus) {
		this.objectStatus = objectStatus;
	}

	public String getPublisher() {
		return this.publisher;
	}

	public void setPublisher(String publisher) {
		this.publisher = publisher;
	}

	public Date getPublisherTime() {
		return this.publisherTime;
	}

	public void setPublisherTime(Date publisherTime) {
		this.publisherTime = publisherTime;
	}

	public int getRefundType() {
		return refundType;
	}

	public void setRefundType(int refundType) {
		this.refundType = refundType;
	}

	public String getRegenerator() {
		return this.regenerator;
	}

	public void setRegenerator(String regenerator) {
		this.regenerator = regenerator;
	}

	public BigDecimal getServiceFeeRate() {
		return BigDecimalUtils.convertNull(this.serviceFeeRate);
	}

	public void setServiceFeeRate(BigDecimal serviceFeeRate) {
		this.serviceFeeRate = serviceFeeRate;
	}

	public Date getTerminateTime() {
		return this.terminateTime;
	}

	public void setTerminateTime(Date terminateTime) {
		this.terminateTime = terminateTime;
	}

	public String getTerminator() {
		return this.terminator;
	}

	public void setTerminator(String terminator) {
		this.terminator = terminator;
	}

	public String getTitle() {
		return this.title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public Date getUpdateTime() {
		return this.updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	public String getVerifier() {
		return this.verifier;
	}

	public void setVerifier(String verifier) {
		this.verifier = verifier;
	}

	public Date getVerifierTime() {
		return this.verifierTime;
	}

	public void setVerifierTime(Date verifierTime) {
		this.verifierTime = verifierTime;
	}

	public int getVersion() {
		return this.version;
	}

	public void setVersion(int version) {
		this.version = version;
	}

	public Date getOnlineTime() {
		return onlineTime;
	}

	public void setOnlineTime(Date onlineTime) {
		this.onlineTime = onlineTime;
	}

	public String getLoaneeName() {
		return loaneeName;
	}

	public void setLoaneeName(String loaneeName) {
		this.loaneeName = loaneeName;
	}

	public Date getFailureTime() {
		return failureTime;
	}

	public void setFailureTime(Date failureTime) {
		this.failureTime = failureTime;
	}

	public int getDeadlineType() {
		return deadlineType;
	}

	public void setDeadlineType(int deadlineType) {
		this.deadlineType = deadlineType;
	}

	public int getIsDel() {
		return isDel;
	}

	public void setIsDel(int isDel) {
		this.isDel = isDel;
	}

	public String getBillCode() {
		return billCode;
	}

	public void setBillCode(String billCode) {
		this.billCode = billCode;
	}

	
}